import request from '@/plugins/axios'

/**
 * 获取未读通知列表
 * @param params source	消息来源(jms、smc、sac、meeting),可选取多个使用,分隔  type	消息类型
 * @returns
 */
export function getMessages(params = {}) {
	return request({
		url: 'service/messages',
		method: 'get',
		params,
	})
}

/**
 * 标记已提醒
 * @param Array[string]
 * @returns */
export function putMessagesAlert(params = {}) {
	return request({
		url: '/web/messages/states/alert',
		method: 'put',
		data: params,
	})
}
/**
 * 标记已读
 * @param Array[string]
 * @returns
 */
export function putMessagesRead(params = {}) {
	return request({
		url: '/web/messages/states/read',
		method: 'put',
		data: params,
	})
}
/**
 * 	获取通知详情
 * @param moid
 * @returns
 */
export function getMessagesAlert(params: any) {
	return request({
		url: `/web/messages/${params.moid}`,
		method: 'get',
		data: params,
	})
}

/**
 * 上报ukey插拔日志
 * @param data
 * @returns
 */
export function sendUKeyEvent(data: any) {
	return request({
		url: `/portal/externals/u_key`,
		data,
		method: 'post',
	})
}
